package Member_Message;

public class Test1ForMember {
    public static void main(String[] args){
        Person[] persons = new Person[10];
        for (int i = 0; i < 10; i++) {
            int member = (int)(Math.random() * 5);
            if (member == 1)
                persons[i] = new Person();
            else if (member == 2)
                persons[i] = new Student();
            else if (member == 3)
                persons[i] = new Employee();
            else if (member == 4)
                persons[i] = new Staff();
            else
                persons[i] = new Faculty();
        }
        printMessage(persons);
    }

    private static void printMessage(Person[] persons){
        for (Person person : persons) {
            System.out.println(person.toString());
        }
    }
}
